package com.hrt.datasender.web.bcparammap212;

import java.util.List;

import com.btcode.orm.model.ModelPageResult;
import com.hrt.datasender.datadao.model.BcParamMap212Model;
import com.hrt.db.DBManager;

public final class BcParamMap212Service {

    private static volatile BcParamMap212Service instance;

    private BcParamMap212Service() {

    }

    public static BcParamMap212Service getInstance() {
        if (instance == null) {
            synchronized (BcParamMap212Service.class) {
                if (instance == null) {
                    instance = new BcParamMap212Service();
                }
            }
        }
        return instance;
    }

    public void create(BcParamMap212Model model) {
        DBManager.getORMExecuter().create(model);
    }

    public void update(BcParamMap212Model model) {
        DBManager.getORMExecuter().update(model);
    }

    public void delete(String id) {
        BcParamMap212Model model = new BcParamMap212Model();
        model.setId(id);
        DBManager.getORMExecuter().delete(model);
    }


    public List<BcParamMap212Model> getList() {
        String sql = "SELECT * FROM BC_PARAM_MAP_212 t ORDER BY t.TRANSPORT_PROTOCOL_ID";
        List<BcParamMap212Model> models = DBManager.getORMExecuter().getModelListSQL(sql,null,BcParamMap212Model.class);
        return models;
    }
}
